home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / Think C dcmd 1.0.1 ƒ / Think Put Lib source / PutUDec.c < prev    next >
Encoding:
Text File  |  1994-06-12  |  304 b   |  18 lines  |  [TEXT/KAHL]

  1. void PutChar(char c);
  2. void PutText(const char* s, int len );
  3. void __DecToText (unsigned long dec, char* str );
  4.  
  5. void PutUDec(unsigned long i )
  6. {
  7.         int         n = 0;
  8.         char*     str = "0000000000";
  9.     
  10.     __DecToText (i, str );
  11.     
  12.     while ( str[n] == '0' && n<9 )
  13.         n++;
  14.     
  15.     PutChar( '#' );
  16.     PutText( &str[n], 10-n );
  17. }
  18.